home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_08 / ctv-mod.txt < prev    next >
Text File  |  1995-01-01  |  5KB  |  121 lines

  1.    To  assist  the  developpers, we  provide  tools  for  developping 
  2.    applications  with Creative Voice System. These tools come in  the 
  3.    form of driver, library functions and link module.
  4.  
  5.  
  6.    CTV-MOD,  is a Microsoft C's link module for supporting the  8-bit 
  7.    voice  data without file header and data compression.  The  source 
  8.    code CTV-MOD.ASM is provided for developpers to tailor this module 
  9.    to any model they desire.
  10.  
  11.  
  12.    Three  global variables have to be declared in the  main  program. 
  13.    They are unsigned integer:
  14.  
  15.      a. io_addx: the card's selectable I/O address used.
  16.                  value  range    : 210, 220, 230, 240, 250 and 260
  17.                  factory default : 220 hex
  18.     
  19.      b. intr_num: the interrupt used for voice output.
  20.                   factory default : 7                
  21.  
  22.      c. voice_status: the status word that indicates the status of voice 
  23.                       output
  24.  
  25.  
  26.    The functions provided are as follow:
  27.  
  28.  
  29.    1. Function   : unint ctv_card_here()
  30.       Description: check  for  the availabilities  of  the  various 
  31.                    music/sound features provided by Creative.
  32.                    
  33.                    The  check is based on the IO address stored  in 
  34.                    the global variable io_addx which is defined  in 
  35.                    the application program.
  36.       Entry      : none
  37.       Return     : Music/sound features available as shown below :
  38.                    The high byte is always zero.
  39.                    The low byte is defined as :
  40.                        bit 0 : set if C/MS music available
  41.                        bit 1 : set if FM music available
  42.                        bit 2 : set if Creative voice available
  43.  
  44.                    The  type  of Creative music/sound card  can  be 
  45.                    determined   from   the   return   value.    The 
  46.                    GameBlaster card will return 1, the SoundBlaster 
  47.                    will return 7 if the FM option is installed or 5 
  48.                    if the FM option is not installed.
  49.  
  50.                    A  zero  return  value may be due  to  wrong  IO 
  51.                    address value in the global value io_addx.
  52.  
  53.    2. Function   : int ctv_detect()
  54.       Description: detects  the existence and functionality of  the 
  55.                    voice card and turn on the speaker by defualt.
  56.       Entry      : none
  57.       Return     : 0, sucessfully initialize
  58.                    1, voice card fails
  59.                    2, I/O read/write fails
  60.                    3, interrupt for DMA fails
  61.       Note       : when a non-zero value is returned, it  indicates 
  62.                    an error, the program should abort.
  63.  
  64.                    Before  this  function  is  called,  the  global 
  65.                    variable io_addx and intr_num must be set to the 
  66.                    correct value.
  67.  
  68.               
  69.    3. Function   : void ctv_speaker(int on_off_flag)
  70.       Description: turns  on/off the speaker.
  71.       Entry      : the integer value on_off_flag set the status  of 
  72.                    the voice output speaker. A non-zero value turns 
  73.                    the speaker on else turns it off.
  74.       Entry      : none
  75.  
  76.  
  77.    4. Function   : int ctv_output(char far* buffer,
  78.                                    unsigned int buffer_len,
  79.                                    unsigned int sampling_rate)
  80.       Description: outputs the voice
  81.       Entry      : buffer is a far pointer to the voice data.
  82.                    buffer_len is the length of the voice data.
  83.                    sampling_rate is the sampling rate used when the 
  84.                    voice is recorded, range 6000 - 18000Hz.
  85.       Exit       : 0, sucessfull
  86.                    1, error because currently there is voice  being 
  87.                    output or paused, voice_status is not zero.
  88.       Note       : while  the  voice being output,  status_word  is 
  89.                    updated  to  a  non-zero  value.  At  the   end, 
  90.                    status_word is set to zero again. 
  91.  
  92.  
  93.    5. Function   : int ctv_pause()
  94.       Description: puases the voice currently being output
  95.       Entry      : none
  96.       Exit       : 0, sucessfull
  97.                    1, error, no voice is currently output
  98.  
  99.  
  100.    6. Function   : int ctv_continue()
  101.       Description: continues the paused voice output
  102.       Entry      : none
  103.       Exit       : 0, sucessfull
  104.                    1, error, no voice output is currently pause
  105.  
  106.  
  107.    7. Function   : int ctv_halt()
  108.       Description: halts the voice currently being output
  109.       Entry      : none
  110.       Exit       : 0, sucessfull
  111.                    1, error, no voice is currently output
  112.  
  113.  
  114.    8. Function   : void ctv_uninstall()
  115.       Description: turn off the speaker and stop the voice  output, 
  116.                    if any.
  117.       Entry      : none
  118.       Exit       : none
  119.  
  120.  
  121.